/*
 * mockMain.cpp
 *
 *  Created on: Oct 10, 2014
 *      Author: root
 */
#include "Communication/Connection.hpp"



/*
int main ()
{
	Connection server(2222);

	Message msg;

	//with timeout
	bool received = server.receiveWithTimeout(&msg , 2);

		if (received && msg.type() == msg.INIT)
		{
			std::cout << "receiveed message: INIT" << std::endl ;

			msg.set_type(msg.ACK);
			bool sent  = server.sendWithTimeout(msg , 1);

			if (sent)
				std::cout << "message sent: ACK" << std::endl ;
			else std::cout << "Timeout - message not sent!!" << std::endl ;
		}
		else if (!received)
		{
			std::cout << "Timeout - No received message" << std::endl ;
		}


     //no timeout - blocking

	received = server.receive(&msg);

	if (received && msg.type() == msg.INIT)
	{
		std::cout << "receiveed message: INIT" << std::endl ;

		msg.set_type(msg.ACK);
		bool sent  = server.send(msg);

		if (sent)
			std::cout << "message sent: ACK" << std::endl ;
	}



	getchar();

}

*/
